package com.ranjiaqi.homework;

import java.io.File;

/**
 * @ClassName homework2
 * @Description TODO
 * @Author hp
 * @Date 2021/7/1 10:47
 * @Version 1.0
 **/
public class homework02 {
    public static void main(String[] args) {
        getAllFile(new File("F:/java/新建文件夹"));
    }

    public static void getAllFile(File f) {

        File[] files = f.listFiles();
        for (File file1 : files) {
            if (file1.isDirectory()){
                getAllFile(file1);
            }
            System.out.println(file1.getName());
            System.out.println(file1.length());
            System.out.println("================");
            System.out.println(file1+"删除"+file1.delete());
        }
        f.delete();
    }
}
